<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>phpcmsV9 - 后台管理中心</title>
<link href="../static/css/reset.css" rel="stylesheet" type="text/css" />
<link href="../static/css/index.css" rel="stylesheet" type="text/css" />
<link href="../static/css/table_form.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="../static/js/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="../static/js/admin_common.js"></script>
<script language="javascript" type="text/javascript" src="../static/js/styleswitch.js"></script>
<script language="javascript" type="text/javascript" src="../static/js/formvalidator.js" charset="UTF-8"></script>
<script language="javascript" type="text/javascript" src="../static/js/formvalidatorregex.js" charset="UTF-8"></script>
<script type="text/javascript"> 
	window.focus();
	var pc_hash = 'RHhlg9';
			window.onload = function(){
		var html_a = document.getElementsByTagName('a');
		var num = html_a.length;
		for(var i=0;i<num;i++) {
			var href = html_a[i].href;
			if(href && href.indexOf('javascript:') == -1) {
				if(href.indexOf('?') != -1) {
					html_a[i].href = href+'&pc_hash='+pc_hash;
				} else {
					html_a[i].href = href+'?pc_hash='+pc_hash;
				}
			}
		}
 
		var html_form = document.forms;
		var num = html_form.length;
		for(var i=0;i<num;i++) {
			var newNode = document.createElement("input");
			newNode.name = 'pc_hash';
			newNode.type = 'hidden';
			newNode.value = pc_hash;
			html_form[i].appendChild(newNode);
		}
	}
</script>
</head>
<body>
<style type="text/css"> 
	html{_overflow-y:scroll}
</style>
<form action="?m=admin&c=setting&a=save" method="post" id="myform">
  <div class="pad-10">
    <div class="col-tab">
      <ul class="tabBut cu-li">
        <li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',5,1);">基本配置</li>
        <li id="tab_setting_2" onclick="SwapTab('setting','on','',5,2);">安全配置</li>
        <li id="tab_setting_3" onclick="SwapTab('setting','on','',5,3);">PHPSSO</li>
        <li id="tab_setting_4" onclick="SwapTab('setting','on','',5,4);">邮箱配置</li>
        <li id="tab_setting_5" onclick="SwapTab('setting','on','',5,5);">connect</li>
      </ul>
      <div id="div_setting_1" class="contentList pad-10">
        <table width="100%"  class="table_form">
          <tr>
            <th width="120">管理员邮箱</th>
            <td class="y-bg"><input type="text" class="input-text" name="setting[admin_email]" id="admin_email" size="30" value="phpcms@phpcms.cn"/></td>
          </tr>
          <tr>
            <th width="120">异步显示栏目层级</th>
            <td class="y-bg"><input type="text" class="input-text" name="setting[category_ajax]" id="category_ajax" size="5" value="0"/>
              &nbsp;&nbsp;&nbsp;&nbsp;<font color="gray">默认为0,即直接显示栏目列表。当栏目层级较多时，可设置首次加载层级，其余使用异步加载，一般设置为2-3</font></td>
          </tr>
          <tr>
            <th width="120">启用页面Gzip压缩</th>
            <td class="y-bg"><input name="setconfig[gzip]" value="1"  type="radio"   checked>
              是&nbsp;&nbsp;&nbsp;&nbsp;
              <input name="setconfig[gzip]" value="0" type="radio"  >
              否</td>
          </tr>
          <tr>
            <th width="120">开启附件状态统计</th>
            <td class="y-bg"><input name="setconfig[attachment_stat]" value="1"  type="radio"   checked>
              是&nbsp;&nbsp;&nbsp;&nbsp;
              <input  name="setconfig[attachment_stat]" value="0" type="radio"  >
              否&nbsp;&nbsp;&nbsp;&nbsp;<font color="gray">记录附件使用状态 ，删除文章时同步删除附件。注意: 本功能会加重服务器负担</font></td>
          </tr>
          <tr>
            <th width="120">JS路径</th>
            <td class="y-bg"><input type="text" class="input-text" name="setconfig[js_path]" id="js_path" size="50" value="../static/js/" /></td>
          </tr>
          <tr>
            <th width="120">CSS路径</th>
            <td class="y-bg"><input type="text" class="input-text" name="setconfig[css_path]" id="css_path" size="50" value="../static/css/"/></td>
          </tr>
          <tr>
            <th width="120">图片路径</th>
            <td class="y-bg"><input type="text" class="input-text" name="setconfig[img_path]" id="img_path" size="50" value="../static/images/" /></td>
          </tr>
          <tr>
            <th width="120">附件URL访问路径</th>
            <td class="y-bg"><input type="text" class="input-text" name="setconfig[upload_url]" id="upload_url" size="50" value="http://192.168.1.27:13/uploadfile/" /></td>
          </tr>
        </table>
      </div>
      <div id="div_setting_2" class="contentList pad-10 hidden">
        <table width="100%"  class="table_form">
          <tr>
            <th width="120">启用后台管理操作日志</th>
            <td class="y-bg"><input name="setconfig[admin_log]" value="1" type="radio" >
              是&nbsp;&nbsp;&nbsp;&nbsp;
              <input name="setconfig[admin_log]" value="0" type="radio"  checked>
              否 </td>
          </tr>
          <tr>
            <th width="120">保存错误日志</th>
            <td class="y-bg"><input name="setconfig[errorlog]" value="1" type="radio"  checked>
              是&nbsp;&nbsp;&nbsp;&nbsp;
              <input name="setconfig[errorlog]" value="0" type="radio" >
              否 </td>
          </tr>
          <tr>
            <th>错误日志预警大小</th>
            <td class="y-bg"><input type="text" class="input-text" name="setting[errorlog_size]" id="errorlog_size" size="5" value="20"/>
              MB</td>
          </tr>
          <tr>
            <th>后台最大登陆失败次数</th>
            <td class="y-bg"><input type="text" class="input-text" name="setting[maxloginfailedtimes]" id="maxloginfailedtimes" size="10" value="8"/></td>
          </tr>
          <tr>
            <th>连续两次刷新最短间隔</th>
            <td class="y-bg"><input type="text" class="input-text" name="setting[minrefreshtime]" id="minrefreshtime" size="10" value="2"/>
              秒</td>
          </tr>
          <tr>
            <th>后台访问域名</th>
            <td class="y-bg"><TABLE>
                <TR>
                  <TD width="270">http://
                    <input type="text" class="input-text" name="setconfig[admin_url]" id="admin_url" size="30" value=""/></TD>
                  <TD>例如：admin.domain.com，绑定后，只能通过该域名登陆，配置保存在 /caches/configs/system.php中，修改参数admin_url可手动取消绑定</TD>
                </TR>
              </TABLE></td>
          </tr>
        </table>
      </div>
      <div id="div_setting_3" class="contentList pad-10 hidden">
        <table width="100%"  class="table_form">
          <tr>
            <th width="120">启用PHPSSO</th>
            <td class="y-bg"><input name="setconfig[phpsso]" value="1" type="radio"   checked>
              是&nbsp;&nbsp;&nbsp;&nbsp;
              <input name="setconfig[phpsso]" value="0" type="radio"  >
              否</td>
          </tr>
          <tr>
            <th>应用ID</th>
            <td class="y-bg"><input type="text" class="input-text" name="setconfig[phpsso_appid]" id="phpsso_appid" size="30" value="1"/></td>
          </tr>
          <tr>
            <th>接口地址</th>
            <td class="y-bg"><input type="text" class="input-text" name="setconfig[phpsso_api_url]" id="phpsso_api_url" size="50" value="http://192.168.1.27:13/phpsso_server"/></td>
          </tr>
          <tr>
            <th>加密密钥</th>
            <td class="y-bg"><input type="text" class="input-text" name="setconfig[phpsso_auth_key]" id="phpsso_auth_key" size="50" value="C8gHPeXTMVPTUh7bYPLKWEUlk0Ak5ZQi"/></td>
          </tr>
          <tr>
            <th>版本号</th>
            <td class="y-bg"><input type="text" class="input-text" name="setconfig[phpsso_version]" id="phpsso_version" size="2" value="1"/></td>
          </tr>
        </table>
      </div>
      <div id="div_setting_4" class="contentList pad-10 hidden">
        <table width="100%"  class="table_form">
          <tr>
            <th width="120">邮件发送模式</th>
            <td class="y-bg"><input name="setting[mail_type]" checkbox="mail_type" value="1" onclick="showsmtp(this)" type="radio"  checked>
              SMTP 函数发送
              <input name="setting[mail_type]" checkbox="mail_type" value="0" onclick="showsmtp(this)" type="radio"  disabled/>
              mail 模块发送 </td>
          </tr>
          <tbody id="smtpcfg" style="">
            <tr>
              <th>邮件服务器</th>
              <td class="y-bg"><input type="text" class="input-text" name="setting[mail_server]" id="mail_server" size="30" value="smtp.qq.com"/></td>
            </tr>
            <tr>
              <th>邮件发送端口</th>
              <td class="y-bg"><input type="text" class="input-text" name="setting[mail_port]" id="mail_port" size="30" value="25"/></td>
            </tr>
            <tr>
              <th>发件人地址</th>
              <td class="y-bg"><input type="text" class="input-text" name="setting[mail_from]" id="mail_from" size="30" value="phpcms.cn@foxmail.com"/></td>
            </tr>
            <tr>
              <th>AUTH LOGIN验证</th>
              <td class="y-bg"><input name="setting[mail_auth]" checkbox="mail_auth" value="1" type="radio"  checked>
                开启
                <input name="setting[mail_auth]" checkbox="mail_auth" value="0" type="radio" >
                关闭</td>
            </tr>
            <tr>
              <th>验证用户名</th>
              <td class="y-bg"><input type="text" class="input-text" name="setting[mail_user]" id="mail_user" size="30" value="phpcms.cn@foxmail.com"/></td>
            </tr>
            <tr>
              <th>验证密码</th>
              <td class="y-bg"><input type="password" class="input-text" name="setting[mail_password]" id="mail_password" size="30" value=""/></td>
            </tr>
          </tbody>
          <tr>
            <th>邮件设置测试</th>
            <td class="y-bg"><input type="text" class="input-text" name="mail_to" id="mail_to" size="30" value=""/>
              <input type="button" class="button" onClick="javascript:test_mail();" value="测试发送"></td>
          </tr>
        </table>
      </div>
      <div id="div_setting_5" class="contentList pad-10 hidden">
        <table width="100%"  class="table_form">
          <tr>
            <th width="120">盛大连接</th>
            <td class="y-bg"> APP key
              <input type="text" class="input-text" name="setconfig[snda_akey]" id="snda_akey" size="20" value=""/>
              APP secret key
              <input type="text" class="input-text" name="setconfig[snda_skey]" id="snda_skey" size="40" value=""/>
              <a href="http://code.snda.com/index/oauth" target="_blank">点击注册</a></td>
          </tr>
          <tr>
            <th>新浪微博</th>
            <td class="y-bg"> App key
              <input type="text" class="input-text" name="setconfig[sina_akey]" id="sina_akey" size="20" value=""/>
              App secret key
              <input type="text" class="input-text" name="setconfig[sina_skey]" id="sina_skey" size="40" value=""/>
              <a href="http://open.t.sina.com.cn/wiki/index.php/连接微博" target="_blank">点击注册</a></td>
          </tr>
          <tr>
            <th>腾讯微博</th>
            <td class="y-bg"> App key
              <input type="text" class="input-text" name="setconfig[qq_akey]" id="qq_akey" size="20" value=""/>
              App secret key
              <input type="text" class="input-text" name="setconfig[qq_skey]" id="qq_skey" size="40" value=""/>
              <a href="http://open.t.qq.com/" target="_blank">点击注册</a></td>
          </tr>
          <tr>
            <th>QQ号码登录</th>
            <td class="y-bg"> App I D  &nbsp;
              <input type="text" class="input-text" name="setconfig[qq_appid]" id="qq_appid" size="20" value=""/>
              App key
              <input type="text" class="input-text" name="setconfig[qq_appkey]" id="qq_appkey" size="40" value=""/>
              回调地址
              <input type="text" class="input-text" name="setconfig[qq_callback]" id="qq_callback" size="40" value=""/>
              <a href="http://connect.qq.com" target="_blank">点击注册</a></td>
          </tr>
        </table>
      </div>
      <div class="bk15"></div>
      <input name="dosubmit" type="submit" value="提交" class="button">
    </div>
  </div>
</form>
</body>
<script type="text/javascript"> 
 
function SwapTab(name,cls_show,cls_hide,cnt,cur){
    for(i=1;i<=cnt;i++){
		if(i==cur){
			 $('#div_'+name+'_'+i).show();
			 $('#tab_'+name+'_'+i).attr('class',cls_show);
		}else{
			 $('#div_'+name+'_'+i).hide();
			 $('#tab_'+name+'_'+i).attr('class',cls_hide);
		}
	}
}
 
function showsmtp(obj,hiddenid){
	hiddenid = hiddenid ? hiddenid : 'smtpcfg';
	var status = $(obj).val();
	if(status == 1) $("#"+hiddenid).show();
	else  $("#"+hiddenid).hide();
}
function test_mail() {
	var mail_type = $('input[checkbox=mail_type][checked]').val();
	var mail_auth = $('input[checkbox=mail_auth][checked]').val();
    $.post('?m=admin&c=setting&a=public_test_mail&mail_to='+$('#mail_to').val(),{mail_type:mail_type,mail_server:$('#mail_server').val(),mail_port:$('#mail_port').val(),mail_user:$('#mail_user').val(),mail_password:$('#mail_password').val(),mail_auth:mail_auth,mail_from:$('#mail_from').val()}, function(data){
	alert(data);
	});
}
 
</script>
</html>
